<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html class="root61">
<head>
	<%@include file="/views/common/include/taglib.jsp"%>
	<%@include file="/views/common/include/head.jsp"%>
	<link type="text/css" rel="stylesheet" href="${ctx}/css/dlifestyle/header.css" />
	<link type="text/css" rel="stylesheet" href="${ctx}/css/dlifestyle/selectcell.css" />
	<link type="text/css" rel="stylesheet" href="${ctx}/css/dlifestyle/table.css" />
</head>
<body class="body" style="margin:0px;">
	<div class="total-head">
	<div class="head" >
		<div style="line-height: 76px;">
			<div style="float:left;">
				<img src="${ctx }/images/seller/login/head-title.png" style="position:relative;vertical-align:middle;"/>
			</div>
			<div class="verticle-line">
			</div>
			<div class="shop-word">
				<span>商户中心</span>
				<span>（选择店铺）</span>
			</div>
		</div>
		<div style="float:right;padding-right: 6px;margin-top:30px;">
			<div style="float:left;"><img src="${ctx }/images/seller/system/member.png"/></div>
			<div style="margin-left:10px;float:left;color:#919191;padding-right:30px;"> ${sessionScope.user_login.username}</div>
			
			<a style="color:#fff;" onclick="exist()">
				<div class="shop-exsit">
					<div style="padding: 5px 0 0 20px;width:20px;float:left;"><img src="${ctx }/images/seller/system/exsit.png"/></div>
					<div style="margin-left:5px;float:left;padding: 3px 0px 0px 2px;"> 退出</div>
				</div>
			</a>
		</div>
	</div>
	<div style="width:100%;height:auto;position: relative;">
		<div style="width:1200px;border:1px solid #709dca;margin: 0 auto;">
			<hr style="height:4px;background-color: #47729D;margin:0px;border-style:none;">
			<div style="height:100px;background-color: #709dca">
				<div style="padding: 18px 0px 0px 60px;float:left;">
					<img src="${ctx}/images/seller/goods/member.png" />
				</div>
				<div style="margin-left:43px;float:left;margin-top: 40px;color:#fff;">
					<span>${sessionScope.user_login.username}</span>
				</div>
				<div style="margin-left:43px;float:left;margin-top: 40px;color:#fff;">
					<div style="float:left;margin-top:3px;"><img src="${ctx}/images/seller/goods/phone.png" /></div>
					<div style="float:left;margin-left:10px;">${sessionScope.user_login.phone}</div>
				</div>
			</div>
			<div style="background-image: url(images/seller/goods/wave.png);background-repeat: repeat-x;height:10px;">
			</div>
			<div style="padding-top:70px;width:1000px;margin:0 auto;min-height: 400px;color: #606060;font-size:14px;">
				<c:if test="${!empty  shopList.list}">
					<c:forEach begin="0" end="${fn:length(shopList.list) - 1}" var="i" >
					<c:set var="shop" value="${(shopList.list)[i]}"/>
					<div style="width:300px;border:1px solid #dadada;border-radius:4px;height:150px;text-align: center;float:left;margin-left:10px;margin-bottom: 20px;">
					<hr style="height:3px;background-color: #709dca;width:300px;margin:0px;"/>
							<a onclick="chooseShop(${shop.id});">
								<div style="width:100%;height:70px;">
									<div style="float:left;padding: 26px 22px 0px 30px;"><img src="${ctx}/images/seller/goods/shop.png" /></div>
									<div style="height:70px;line-height:70px;float:left;">店铺名：${shop.name }</div>
								</div>
								<div><hr style="border:0;border-top:2px dotted #709dca;width:272px;margin:0 auto;"></div>
								<div style="width:100%;height:70px;">
									<div style="float:left;padding: 26px 22px 0px 30px;"><img src="${ctx}/images/seller/goods/cell.png" /></div>
									<div style="line-height:70px;float:left;">小区名：${shop.cellName }</div>
								</div>
							</a>
					</div>
					</c:forEach>
				</c:if>
				<div style="width:300px;height:150px;text-align: center;float:left;margin-left:10px;">
					<img src="${ctx}/images/seller/goods/shopimg.png" />
				</div>  
			</div>
		</div>
		<div style="width:100%;">
		<table style="width:1200px;margin:0 auto;">
               	<tfoot>
	            	<tr>
		               <td colspan="8">
		                    <div style="float:right;margin-top: 30px;font-family: '微软雅黑'"> 
			                  <div style="float:left;">                 
			                      <ul class="footer_ul" style="margin-top:0px;">
			                      	<c:if test="${shopList.hasPreviousPage }">
			                        	<li onclick="gotoPage(${currentPage-1 });"><a class="leftRight">&lt;&lt;</a></li>
			                      	</c:if>
			                        <c:if test="${shopList.firstPage > 1}">
			                        	<li onclick="gotoPage(1);" style="border: 1px solid #9A9A9A;">
			                             	<a>1</a>
			                        	</li>
			                        	<c:if test="${shopList.firstPage > 2}">
			                        		...
			                        	</c:if>
			                      	</c:if>
			                        <c:forEach items="${shopList.navigatepageNums }" var="page">
			                        <li onclick="gotoPage(${page });" class="<c:if test="${currentPage == page }">active</c:if>" style="border: 1px solid #9A9A9A;">
			                             <a>${page}</a>
			                        </li>
			                        </c:forEach>
			                        <c:if test="${shopList.lastPage < shopList.pages}">
			                        	<c:if test="${shopList.firstPage < shopList.pages - 1}">
			                        		...
			                        	</c:if>
			                        	<li onclick="gotoPage(${shopList.pages});" style="border: 1px solid #9A9A9A;">
			                             	<a>${shopList.pages}</a>
			                        	</li>
			                      	</c:if>
			                        <c:if test="${shopList.hasNextPage }">
			                        <li><a onclick="gotoPage(${currentPage+1});" class="leftRight">&gt;&gt;</a></li>
			                      	</c:if>
			                      </ul>
		                     </div>
	                   		 <div style="float:left;  height: 28px;line-height: 28px;">
								<span style="color: #9A9A9A;">跳转到</span> 
								<input class="inputclass" id="pageNo" onkeydown="if(event.keyCode==13){event.keyCode=0;return false;}" type="text" value="${currentPage }" style="width:26px;height:26px">
								<span style="color: #9A9A9A;">页</span> 
								<span class="buttonclass" id="J_JumpTo" onclick="gotoShopPage(null);"><a>GO</a></span>
							 </div>
			             </div>
			         </td>
			      </tr>
			    </tfoot>
		     </table>
	      </div>
       </div>
    </div>

</body>
<script type="text/javascript">
		var ctx;
		
		function setCtx(ctx){
			this.ctx = ctx;
		}
		
		function chooseShop(shopId){
			if(shopId != null && shopId != undefined){
				$.get(ctx+"/getMenuByShopId?timestamp=" + Date.parse(new Date()),{
					shopId : shopId
				},function(data){
					data = JSON.parse(data);
					if(data.success){
						location.href = ctx + "/main";
					}else{
						layer.msg(data.msg, {icon: 5});
					}
				});
			}
		}
		
		function exist(){
			layer.confirm('确认注销?', {icon: 3, title:'提示'}, function(index){
			   	$.get("${ctx}/exist",{},function(data){
			   		data = JSON.parse(data);
					if(data.success){
						location.href = "${ctx}";
					}
				});
			    layer.close(index);
			});
		    
		} 
		
		function gotoPage(page){
			window.location.href="${ctx}/selectShop?pNo="+page;
		}
		
		function gotoShopPage(page) {
			if(page == null){
				page = $(".inputclass").val();
			}
			window.location.href="${ctx}/selectShop?pNo="+page;
		}
		
</script>
<script type="text/javascript">
		var ctx = '${ctx}';
		
		setCtx(ctx);
		
</script>
</html>

